<template>
	<view class="content">
		<view class="body">
			<textarea placeholder="感谢你使用我们的app，使用过程有任何意见和建议请反馈给我们。" v-model="desc" class="liuyan" rows="3" cols="50"></textarea>
		</view>
		<button class="anniu" @tap="showToast">提交</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				uid:'',
				userid:'',
				msg:''
			};
		},
		methods: {
			showToast:function () {
				uni.request({
					url:'http://xj.gccrw.cn/api/Set/feedback',
					data:{
						uid:this.userid,
						desc:this.desc
					},
					method:'POST',
					success: (res) => {
						if(this.desc == null){
							uni.showModal({
								content:'意见不能为空'
							})
						}else {
							console.log('111',this.msg)
							uni.navigateBack({
								delta:1,
								success:(res) => {
									uni.showToast({
										title:'提交成功'
									})
								}
							})
						}
					}
				})
			},
		},
		onLoad (e) {
			console.log(e.uid);
			this.userid = e.uid
		}
	}
</script>

<style>
.body{
	width: 100%;
	height: 500upx;
	background-color: #EEEEEE;
	display: flex;
	flex-direction: column;
	border-radius: 20upx;
}
.liuyan{
	width: 98%;
	padding: 20upx;
}
.anniu{
	width: 70%;
	/* background-color: #A7BCE7; */
	background-color: #3C6DD2;
	color: #FFFFFF;
	border-radius: 23upx;
	text-align: center;
	margin-top: 40upx;
	margin-bottom: 40upx;
}
</style>
